using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EpubLibrary;
namespace iBooks.Ajax
{
    public partial class parseURL : System.Web.UI.Page
    {
        protected string content = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            string url = Request.QueryString["url"] == null ? "" : Request.QueryString["url"].ToString();
            string isImage = Request.QueryString["isImage"] == null ? "" : Request.QueryString["isImage"].ToString();
            string minWidth = Request.QueryString["mWidth"] == null ? "0" : Request.QueryString["mWidth"].ToString();
            url = Uri.UnescapeDataString(url);
            if (url == "")
                content = "";
            else if (isImage == "1")
                content = EpubFactory.extractMainContentOfImagesPage(url, Convert.ToInt32(minWidth));
            else
                content = EpubFactory.extractMainContentOfWebPage(url);
        }
    }
}
